package priv.pront.code.robot.roboCom_uni;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-06-29 15:34
 */
public class P1808_单词分类 {

    static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    static int n;
    static Set<String> set = new HashSet<>();
    public static void main(String[] args) throws IOException {
        String s = bf.readLine();
        n = Integer.parseInt(s);
        for (int i = 0; i < n; i++) {
            char[] chs = bf.readLine().toCharArray();
            Arrays.sort(chs);
            set.add(new String(chs));
        }
        System.out.println(set.size());
    }
}
